services:
  mongodb:
    image: mongo:6.0.5
    container_name: mongodb
    networks:
      network:
    restart: always
    volumes:
      - mongodb_data_db:/data/db
      - mongodb_data_configdb:/data/configdb
    ports:
      - 27017:27017
    logging:
      driver: 'json-file'
      options:
        max-file: '1'
        max-size: '1m'

  backend:
    build:
      context: ../..
      dockerfile: infrastructure/local/Dockerfile
    container_name: backend
    networks:
      network:
    restart: always
    ports:
      - 9000:8080
    logging:
      driver: 'json-file'
      options:
        max-file: '1'
        max-size: '1m'
    env_file: .env

networks:
  network:
    driver: bridge
    name: 'angrywords_network'

volumes:
  mongodb_data_db:
    name: 'angrywords_mongodb_data_db'
  mongodb_data_configdb:
    name: 'angrywords_mongodb_data_configdb'